
cmake_minimum_required(VERSION 3.25)
include_directories(
    ${CMAKE_SOURCE_DIR}/include
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_SOURCE_DIR}/extlib/mimalloc/include
    )
file(GLOB AS extlib/mimalloc/src/*.c)
# add_definitions(-DUNIX_DATADIR "/home/lei/")
add_definitions(-DLIBRARY)
aux_source_directory(src slvs)
aux_source_directory(extlib/mimalloc/src mimalloc)
add_library(slvs ${slvs} src/platform/platform.cpp 
/home/lei/文档/python_solvespace-3.0.8/python_solvespace/extlib/mimalloc/src/heap.c
extlib/mimalloc/src/options.c
extlib/mimalloc/src/page.c
extlib/mimalloc/src/segment.c
extlib/mimalloc/src/alloc.c
extlib/mimalloc/src/init.c
extlib/mimalloc/src/random.c
extlib/mimalloc/src/stats.c
extlib/mimalloc/src/os.c
extlib/mimalloc/src/arena.c
extlib/mimalloc/src/bitmap.c

extlib/mimalloc/src/segment-cache.c
extlib/mimalloc/src/alloc-aligned.c

)
target_link_libraries(slvs -lpthread)
# message(${AS})
add_executable(CDemo
    CDemo.cc)

target_link_libraries(CDemo
    slvs)

if(EMSCRIPTEN)
    set_target_properties(CDemo PROPERTIES
        LINK_FLAGS "-s TOTAL_MEMORY=134217728")
endif()
